﻿namespace Forms
{
    using Forms.My;
    using Forms.My.Resources;

    using Microsoft.VisualBasic.CompilerServices;

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.IO;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class frmF1_Auswertung : Form
    {
        [AccessedThroughProperty("Bemerkung")]
        private DataGridViewTextBoxColumn _Bemerkung;
        [AccessedThroughProperty("butFilter")]
        private ToolStripSplitButton _butFilter;
        [AccessedThroughProperty("cmbFilter")]
        private ToolStripComboBox _cmbFilter;
        [AccessedThroughProperty("cmbFilterNach")]
        private ToolStripComboBox _cmbFilterNach;
        [AccessedThroughProperty("DataGridViewF1A")]
        private DataGridView _DataGridViewF1A;
        [AccessedThroughProperty("DatenschemaBMW")]
        private DatenschemaBMW _DatenschemaBMW;
        [AccessedThroughProperty("DatumDataGridViewTextBoxColumn")]
        private DataGridViewTextBoxColumn _DatumDataGridViewTextBoxColumn;
        [AccessedThroughProperty("EKPreisDataGridViewTextBoxColumn")]
        private DataGridViewTextBoxColumn _EKPreisDataGridViewTextBoxColumn;
        [AccessedThroughProperty("FGSTNrDataGridViewTextBoxColumn")]
        private DataGridViewTextBoxColumn _FGSTNrDataGridViewTextBoxColumn;
        [AccessedThroughProperty("FilterZurücksetzenToolStripMenuItem")]
        private ToolStripMenuItem _FilterZurücksetzenToolStripMenuItem;
        [AccessedThroughProperty("TABAuswertungBestandBindingSource")]
        private BindingSource _TABAuswertungBestandBindingSource;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("txtFilterNach")]
        private ToolStripTextBox _txtFilterNach;
        private IContainer components;
        public int[] FilterID;
        public string FilterString;

        public frmF1_Auswertung()
        {
            base.Leave += new EventHandler(this.frmF1_Auswertung_Leave);
            this.FilterID = new int[0x65];
            this.InitializeComponent();
        }

        private void cmbFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.InitFilter();
            MyProject.Forms.Main.InitData(Main.TableType.BestandA, this.cmbFilter.SelectedIndex);
        }

        private void cmbFilterNach_SelectedIndexChanged(object sender, EventArgs e)
        {
            MyProject.Forms.Main.InitData(Main.TableType.BestandA, this.cmbFilter.SelectedIndex);
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        public void FilterChange(int FilterIndex)
        {
            DataView view = new DataView();
            view.Table = MyProject.Forms.Main.cs.Table_Auswertung_Bestand;
            switch (FilterIndex)
            {
                case 0:
                    this.ResetFilter();
                    break;

                case 1:
                    if (this.cmbFilterNach.SelectedIndex > -1 && FilterID.GetValue(this.cmbFilterNach.SelectedIndex) != null)
                    {
                        this.FilterString = "Bestand_Header_ID='"
                                            + Conversions.ToString(this.FilterID[this.cmbFilterNach.SelectedIndex])
                                            + "'";
                        view.RowFilter = this.FilterString;
                    }
                    break;
            }
            if (FilterIndex > -1)
            {
                this.DataGridViewF1A.DataSource = view;
            }
        }

        private void FilterZurücksetzenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.ResetFilter();
        }

        private void frmF1_Auswertung_Leave(object sender, EventArgs e)
        {
            MyProject.Forms.Main.StatusLabel.Text = "Speichere...";
            MyProject.Forms.Main.Refresh();
            MyProject.Forms.Main.cs.BemerkungenSpeichernAuswertungBestand();
            MyProject.Forms.Main.StatusLabel.Text = "Bereit!";
        }

        private void InitFilter()
        {
            switch (this.cmbFilter.SelectedIndex)
            {
                case 0:
                    this.ResetFilter();
                    break;

                case 1:
                {
                    IEnumerator enumerator = MyProject.Forms.Main.cs.Table_BestandHeaders.Rows.GetEnumerator();
                    ToolStripComboBox cmbFilterNach = this.cmbFilterNach;
                    cmbFilterNach.Items.Clear();
                    try
                    {
                        
                        while (enumerator.MoveNext())
                        {
                            DataRow current = (DataRow) enumerator.Current;
                            int index = cmbFilterNach.Items.Add(Path.GetFileName(Conversions.ToString(current["FileName"])));
                            this.FilterID[index] = Conversions.ToInteger(current["Bestand_Header_Id"]);
                        }
                    }
                    finally
                    {
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    if (cmbFilterNach.Items.Count > 0)
                    {
                        cmbFilterNach.SelectedIndex = 0;
                    }
                    else
                    {
                        cmbFilterNach.SelectedIndex = -1;
                    }
                    cmbFilterNach.Visible = true;
                    cmbFilterNach = null;
                    this.txtFilterNach.Text = "";
                    this.txtFilterNach.Visible = false;
                    break;
                }
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new Container();
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            this.DataGridViewF1A = new DataGridView();
            this.FGSTNrDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
            this.DatumDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
            this.EKPreisDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
            this.Bemerkung = new DataGridViewTextBoxColumn();
            this.TABAuswertungBestandBindingSource = new BindingSource(this.components);
            this.DatenschemaBMW = new DatenschemaBMW();
            this.ToolStrip1 = new ToolStrip();
            this.butFilter = new ToolStripSplitButton();
            this.FilterZurücksetzenToolStripMenuItem = new ToolStripMenuItem();
            this.cmbFilter = new ToolStripComboBox();
            this.cmbFilterNach = new ToolStripComboBox();
            this.txtFilterNach = new ToolStripTextBox();
            ((ISupportInitialize) this.DataGridViewF1A).BeginInit();
            ((ISupportInitialize) this.TABAuswertungBestandBindingSource).BeginInit();
            this.DatenschemaBMW.BeginInit();
            this.ToolStrip1.SuspendLayout();
            this.SuspendLayout();
            this.DataGridViewF1A.AllowUserToAddRows = false;
            this.DataGridViewF1A.AllowUserToDeleteRows = false;
            this.DataGridViewF1A.AllowUserToOrderColumns = true;
            this.DataGridViewF1A.AllowUserToResizeRows = false;
            this.DataGridViewF1A.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.DataGridViewF1A.AutoGenerateColumns = false;
            this.DataGridViewF1A.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
            style.Alignment = DataGridViewContentAlignment.MiddleLeft;
            style.BackColor = SystemColors.Control;
            style.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            style.ForeColor = SystemColors.WindowText;
            style.SelectionBackColor = SystemColors.Highlight;
            style.SelectionForeColor = SystemColors.HighlightText;
            style.WrapMode = DataGridViewTriState.True;
            this.DataGridViewF1A.ColumnHeadersDefaultCellStyle = style;
            this.DataGridViewF1A.Columns.AddRange(new DataGridViewColumn[] { this.FGSTNrDataGridViewTextBoxColumn, this.DatumDataGridViewTextBoxColumn, this.EKPreisDataGridViewTextBoxColumn, this.Bemerkung });
            this.DataGridViewF1A.Cursor = Cursors.Default;
            this.DataGridViewF1A.DataSource = this.TABAuswertungBestandBindingSource;
            style3.Alignment = DataGridViewContentAlignment.MiddleLeft;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridViewF1A.DefaultCellStyle = style3;
            Point point = new Point(0, 0x18);
            this.DataGridViewF1A.Location = point;
            this.DataGridViewF1A.MultiSelect = false;
            this.DataGridViewF1A.Name = "DataGridViewF1A";
            style4.Alignment = DataGridViewContentAlignment.MiddleLeft;
            style4.BackColor = SystemColors.Control;
            style4.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            style4.WrapMode = DataGridViewTriState.True;
            this.DataGridViewF1A.RowHeadersDefaultCellStyle = style4;
            this.DataGridViewF1A.RowHeadersVisible = false;
            this.DataGridViewF1A.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DataGridViewF1A.ShowCellToolTips = false;
            Size size = new Size(820, 0x246);
            this.DataGridViewF1A.Size = size;
            this.DataGridViewF1A.TabIndex = 1;
            this.FGSTNrDataGridViewTextBoxColumn.DataPropertyName = "FGST_Nr";
            this.FGSTNrDataGridViewTextBoxColumn.HeaderText = "Fahrgestell-Nr.";
            this.FGSTNrDataGridViewTextBoxColumn.Name = "FGSTNrDataGridViewTextBoxColumn";
            this.FGSTNrDataGridViewTextBoxColumn.ReadOnly = true;
            this.FGSTNrDataGridViewTextBoxColumn.Width = 150;
            this.DatumDataGridViewTextBoxColumn.DataPropertyName = "Datum";
            this.DatumDataGridViewTextBoxColumn.HeaderText = "Datum";
            this.DatumDataGridViewTextBoxColumn.Name = "DatumDataGridViewTextBoxColumn";
            this.DatumDataGridViewTextBoxColumn.ReadOnly = true;
            this.DatumDataGridViewTextBoxColumn.Width = 0x85;
            this.EKPreisDataGridViewTextBoxColumn.DataPropertyName = "EK-Preis";
            style2.Alignment = DataGridViewContentAlignment.MiddleRight;
            style2.Format = "N2";
            this.EKPreisDataGridViewTextBoxColumn.DefaultCellStyle = style2;
            this.EKPreisDataGridViewTextBoxColumn.HeaderText = "EK-Preis";
            this.EKPreisDataGridViewTextBoxColumn.Name = "EKPreisDataGridViewTextBoxColumn";
            this.EKPreisDataGridViewTextBoxColumn.ReadOnly = true;
            this.EKPreisDataGridViewTextBoxColumn.Width = 140;
            this.Bemerkung.DataPropertyName = "Bemerkung";
            this.Bemerkung.HeaderText = "Bemerkung";
            this.Bemerkung.Name = "Bemerkung";
            this.Bemerkung.Width = 250;
            this.TABAuswertungBestandBindingSource.DataMember = "TAB_Auswertung_Bestand";
            this.TABAuswertungBestandBindingSource.DataSource = this.DatenschemaBMW;
            this.DatenschemaBMW.DataSetName = "DatenschemaBMW";
            this.DatenschemaBMW.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.butFilter, this.cmbFilter, this.cmbFilterNach, this.txtFilterNach });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(820, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 2;
            this.ToolStrip1.Text = "ToolStrip1";
            this.butFilter.DropDownItems.AddRange(new ToolStripItem[] { this.FilterZurücksetzenToolStripMenuItem });
            this.butFilter.Image = Resources.Symbol_Filter;
            this.butFilter.ImageAlign = ContentAlignment.BottomCenter;
            this.butFilter.ImageTransparentColor = Color.Magenta;
            this.butFilter.Name = "butFilter";
            size = new Size(0x41, 0x16);
            this.butFilter.Size = size;
            this.butFilter.Text = "Filter";
            this.butFilter.TextAlign = ContentAlignment.BottomRight;
            this.FilterZurücksetzenToolStripMenuItem.Name = "FilterZurücksetzenToolStripMenuItem";
            size = new Size(0xab, 0x16);
            this.FilterZurücksetzenToolStripMenuItem.Size = size;
            this.FilterZurücksetzenToolStripMenuItem.Text = "Filter zurücksetzen";
            this.cmbFilter.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbFilter.FlatStyle = FlatStyle.Standard;
            this.cmbFilter.Items.AddRange(new object[] { "kein", "nach Bestandsdatei" });
            this.cmbFilter.Name = "cmbFilter";
            size = new Size(160, 0x19);
            this.cmbFilter.Size = size;
            this.cmbFilterNach.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbFilterNach.FlatStyle = FlatStyle.Standard;
            this.cmbFilterNach.Name = "cmbFilterNach";
            size = new Size(130, 0x19);
            this.cmbFilterNach.Size = size;
            this.txtFilterNach.BorderStyle = BorderStyle.FixedSingle;
            this.txtFilterNach.Name = "txtFilterNach";
            size = new Size(130, 0x19);
            this.txtFilterNach.Size = size;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackColor = SystemColors.ControlDark;
            size = new Size(820, 0x25e);
            this.ClientSize = size;
            this.Controls.Add(this.ToolStrip1);
            this.Controls.Add(this.DataGridViewF1A);
            this.FormBorderStyle = FormBorderStyle.None;
            this.Name = "frmF1_Auswertung";
            this.Text = "frmF1_Auswertung";
            ((ISupportInitialize) this.DataGridViewF1A).EndInit();
            ((ISupportInitialize) this.TABAuswertungBestandBindingSource).EndInit();
            this.DatenschemaBMW.EndInit();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void ResetFilter()
        {
            this.cmbFilter.SelectedIndex = 0;
            this.cmbFilterNach.SelectedIndex = -1;
            this.txtFilterNach.Text = "";
            this.cmbFilterNach.Visible = false;
            this.txtFilterNach.Visible = true;
            this.txtFilterNach.Enabled = false;
            this.FilterString = "";
        }

        private void txtFilterNach_TextChanged(object sender, EventArgs e)
        {
            MyProject.Forms.Main.InitData(Main.TableType.BestandA, this.cmbFilter.SelectedIndex);
        }

        internal virtual DataGridViewTextBoxColumn Bemerkung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Bemerkung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Bemerkung = value;
            }
        }

        internal virtual ToolStripSplitButton butFilter
        {
            [DebuggerNonUserCode]
            get
            {
                return this._butFilter;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._butFilter = value;
            }
        }

        internal virtual ToolStripComboBox cmbFilter
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmbFilter;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmbFilter_SelectedIndexChanged);
                if (this._cmbFilter != null)
                {
                    this._cmbFilter.SelectedIndexChanged -= handler;
                }
                this._cmbFilter = value;
                if (this._cmbFilter != null)
                {
                    this._cmbFilter.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ToolStripComboBox cmbFilterNach
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmbFilterNach;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmbFilterNach_SelectedIndexChanged);
                if (this._cmbFilterNach != null)
                {
                    this._cmbFilterNach.SelectedIndexChanged -= handler;
                }
                this._cmbFilterNach = value;
                if (this._cmbFilterNach != null)
                {
                    this._cmbFilterNach.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual DataGridView DataGridViewF1A
        {
            [DebuggerNonUserCode]
            get
            {
                return this._DataGridViewF1A;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._DataGridViewF1A = value;
            }
        }

        internal virtual DatenschemaBMW DatenschemaBMW
        {
            [DebuggerNonUserCode]
            get
            {
                return this._DatenschemaBMW;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._DatenschemaBMW = value;
            }
        }

        internal virtual DataGridViewTextBoxColumn DatumDataGridViewTextBoxColumn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._DatumDataGridViewTextBoxColumn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._DatumDataGridViewTextBoxColumn = value;
            }
        }

        internal virtual DataGridViewTextBoxColumn EKPreisDataGridViewTextBoxColumn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._EKPreisDataGridViewTextBoxColumn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._EKPreisDataGridViewTextBoxColumn = value;
            }
        }

        internal virtual DataGridViewTextBoxColumn FGSTNrDataGridViewTextBoxColumn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._FGSTNrDataGridViewTextBoxColumn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._FGSTNrDataGridViewTextBoxColumn = value;
            }
        }

        internal virtual ToolStripMenuItem FilterZurücksetzenToolStripMenuItem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._FilterZurücksetzenToolStripMenuItem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.FilterZurücksetzenToolStripMenuItem_Click);
                if (this._FilterZurücksetzenToolStripMenuItem != null)
                {
                    this._FilterZurücksetzenToolStripMenuItem.Click -= handler;
                }
                this._FilterZurücksetzenToolStripMenuItem = value;
                if (this._FilterZurücksetzenToolStripMenuItem != null)
                {
                    this._FilterZurücksetzenToolStripMenuItem.Click += handler;
                }
            }
        }

        internal virtual BindingSource TABAuswertungBestandBindingSource
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TABAuswertungBestandBindingSource;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TABAuswertungBestandBindingSource = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripTextBox txtFilterNach
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtFilterNach;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.txtFilterNach_TextChanged);
                if (this._txtFilterNach != null)
                {
                    this._txtFilterNach.TextChanged -= handler;
                }
                this._txtFilterNach = value;
                if (this._txtFilterNach != null)
                {
                    this._txtFilterNach.TextChanged += handler;
                }
            }
        }
    }
}

